package nc.impl.levm;

import nc.impl.pub.ace.AceLevm_supppcPubServiceImpl;
import nc.impl.pubapp.pub.smart.BatchSaveAction;
import nc.vo.bd.meta.BatchOperateVO;
import nc.ui.querytemplate.querytree.IQueryScheme;
import nc.vo.pub.BusinessException;
import nc.vo.pub.lang.UFDateTime;
import nc.vo.pubapp.AppContext;
import nc.vo.levm.supppc.SupppcVO;
import nc.itf.levm.ILevm_supppcMaintain;

public class Levm_supppcMaintainImpl extends AceLevm_supppcPubServiceImpl
		implements ILevm_supppcMaintain {

	@Override
	public SupppcVO[] query(IQueryScheme queryScheme) throws BusinessException {
		return super.pubquerybasedoc(queryScheme);
	}

	@Override
	public BatchOperateVO batchSave(BatchOperateVO batchVO) throws BusinessException {
		BatchSaveAction<SupppcVO> saveAction = new BatchSaveAction<SupppcVO>();
		Object[] addvos=batchVO.getAddObjs();
		Object[] updatevos=batchVO.getUpdObjs();
		if(addvos!=null &&addvos.length>0) {
			for(Object vo:addvos) {
				SupppcVO vo2=(SupppcVO) vo;
				vo2.setCreator(AppContext.getInstance().getPkUser());
				vo2.setCreationtime(new UFDateTime(System.currentTimeMillis()));
				vo2.setMaketime(new UFDateTime(System.currentTimeMillis()));
			}
		}
		if(updatevos!=null &&updatevos.length>0) {
			for(Object vo:updatevos) {
				SupppcVO vo2=(SupppcVO) vo;
				vo2.setModifier(AppContext.getInstance().getPkUser());
				vo2.setModifiedtime(new UFDateTime(System.currentTimeMillis()));
			}
		}
		BatchOperateVO retData = saveAction.batchSave(batchVO);
		return retData;
	}
}
